package com.yuchen.ishop.service.goods;

import com.yuchen.ishop.entity.GoodsHouse;
import com.yuchen.jaxrs.restclient.RestClientUtils;
import com.yuchen.utils.config.ConfigUtils;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 *
 */
@Service
public class GoodsHouseRestClient {

    public GoodsHouse get(Long goodsId) {
        String url = ConfigUtils.config.get("goodshouse_get");
        Map map = new HashMap(1);
        map.put("id",goodsId);
        url = RestClientUtils.url(url, map);
        return RestClientUtils.get(GoodsHouse.class, url);
    }

    public List findXiaoqu(String keyword){
        String url = ConfigUtils.config.get("goodshouse_findXiaoqu");
        return RestClientUtils.post(List.class,keyword,url);

    }
}
